package com.blyat.xsoft.auth.restful.mapper;

import com.blyat.xsoft.auth.restful.entity.Role;
import com.blyat.xsoft.kernel.restful.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author syh
 * @date 2019/10/21
 **/
public interface RoleMapper extends BaseMapper<Role> {

    Integer checkCodeExist(@Param("code") String code);

    List<Role> getByUserId(@Param("userId") String userId);

    List<Role> findAll() throws Exception;

    int deletePermissionByRoleId(@Param("roleId") String roleId);

    int deletePermissionByRoleIds(String[] roleIds);

    int updateRolePermission(@Param("roleId") String roleId, @Param("authIds") List<String> authIds);
}
